package com.leolian.transaction;

import javax.annotation.Resource;
import javax.sql.DataSource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.leolian.spring02.transaction.demo1.AccountService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:transaction/applicationContext1.xml")
public class TransactionTest1 {
	
	@Resource(name="accountService")
	private AccountService accountService;
	
	@Resource(name="dataSource")
	private DataSource dataSource;
	
	@Test
	public void testDataSource(){
		System.out.println(dataSource);
	}
	
	@Test
	public void testTransfer(){
		accountService.transfer("aaa", "bbb", 200d);
		System.out.println("转账完毕！");
	}
	
}
